<!DOCTYPE html>
<html>
    <head>
        <title>炼铁高炉</title>
        <meta charset="UTF-8">
        <link rel="shortcut icon" href="custom/images/favicon.ico?v=2" />
        <style>
            html, body {
                padding: 0px;
                margin: 0px;
            }
        </style>

        <script src='custom/configs/htconfig.js'></script>
        <script src='custom/libs/echarts.js'></script>
        <script src='libs/ht.js'></script>
        <script src="libs/ht-obj.js"></script>
        <script src='libs/ht-animation.js'></script>
        <script src='libs/ht-vector.js'></script>
     
    </head>
    <body>
        <script>
            !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.g=e()}(this,function(){"use strict";var o={getParam:function(t){var e=new RegExp("(^|&)"+t+"=([^&]*)(&|$)"),a=window.location.search.substr(1).match(e);return null!=a?decodeURIComponent(a[2]):null},formatDate:function(t,e){var a=e;a=(a=a.replace(/yyyy|YYYY/,t.getFullYear())).replace(/yy|YY/,9<t.getYear()%100?(t.getYear()%100).toString():"0"+t.getYear()%100);var n=t.getMonth()+1;return a=(a=(a=(a=(a=(a=(a=(a=(a=(a=(a=a.replace(/MM/,9<n?n.toString():"0"+n)).replace(/M/g,n)).replace(/w|W/g,["日","一","二","三","四","五","六"][t.getDay()])).replace(/dd|DD/,9<t.getDate()?t.getDate().toString():"0"+t.getDate())).replace(/d|D/g,t.getDate())).replace(/hh|HH/,9<t.getHours()?t.getHours().toString():"0"+t.getHours())).replace(/h|H/g,t.getHours())).replace(/mm/,9<t.getMinutes()?t.getMinutes().toString():"0"+t.getMinutes())).replace(/m/g,t.getMinutes())).replace(/ss|SS/,9<t.getSeconds()?t.getSeconds().toString():"0"+t.getSeconds())).replace(/s|S/g,t.getSeconds())},setBindingData:function(t,r){t.each(function(t){var e=t.getDataBindings();if(e){for(var a in e.a){var n=e.a[a];void 0!==(i=r[n.id])&&(n.func&&(i=n.func(i)),t.a(a,i))}for(var a in e.s){n=e.s[a];void 0!==(i=r[n.id])&&(n.func&&(i=n.func(i)),t.s(a,i))}for(var a in e.p){var i;n=e.p[a];void 0!==(i=r[n.id])&&(n.func&&(i=n.func(i)),t[ht.Default.setter(a)](i))}}})},setBindingDataWithAnimation:function(t,r){var o=this;t.each(function(t){var e=t.getDataBindings();if(e){for(var a in e.a){var n=e.a[a];void 0!==(i=r[n.id])&&(n.func&&(i=n.func(i)),o.setValueWithAnimation(t,a,i,null,"a"))}for(var a in e.s){n=e.s[a];void 0!==(i=r[n.id])&&(n.func&&(i=n.func(i)),o.setValueWithAnimation(t,a,i,null,"s"))}for(var a in e.p){var i;n=e.p[a];void 0!==(i=r[n.id])&&(n.func&&(i=n.func(i)),o.setValueWithAnimation(t,a,i,null,"p"))}}})},setValueWithAnimation:function(n,i,t,r){var o=4<arguments.length&&void 0!==arguments[4]?arguments[4]:"a",s=void 0,l=t-(s="a"===o?n.a(i):"s"===o?n.s(i):n[ht.Default.getter(i)]());ht.Default.startAnim({frames:12,interval:10,easing:function(t){return 1- --t*t*t*t},action:function(t,e){var a=s+l*t;r&&(a=r(a)),"a"===o?n.a(i,a):"s"===o?n.s(i,a):n[ht.Default.setter(i)]()(n,a)}})},toFixed:function(t,e){return"string"==typeof t&&(t=parseFloat(t)),t.toFixed(e)}},i=(function(){function h(t){this.value=t}function t(i){var r,o;function s(t,e){try{var a=i[t](e),n=a.value;n instanceof h?Promise.resolve(n.value).then(function(t){s("next",t)},function(t){s("throw",t)}):l(a.done?"return":"normal",a.value)}catch(t){l("throw",t)}}function l(t,e){switch(t){case"return":r.resolve({value:e,done:!0});break;case"throw":r.reject(e);break;default:r.resolve({value:e,done:!1})}(r=r.next)?s(r.key,r.arg):o=null}this._invoke=function(n,i){return new Promise(function(t,e){var a={key:n,arg:i,resolve:t,reject:e,next:null};o?o=o.next=a:(r=o=a,s(n,i))})},"function"!=typeof i.return&&(this.return=void 0)}"function"==typeof Symbol&&Symbol.asyncIterator&&(t.prototype[Symbol.asyncIterator]=function(){return this}),t.prototype.next=function(t){return this._invoke("next",t)},t.prototype.throw=function(t){return this._invoke("throw",t)},t.prototype.return=function(t){return this._invoke("return",t)}}(),function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}),t=function(){function n(t,e){for(var a=0;a<e.length;a++){var n=e[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(t,e,a){return e&&n(t.prototype,e),a&&n(t,a),t}}(),n=function(){function n(t){var e=this;i(this,n),this.main=t,this.g3d=t.g3d,this.siteCode=t.siteCode;var a=this.dm=this.g3d.dm();a.enableAnimation(50),this.coalgas=a.getDataByTag("coalgas"),this.materia=a.getDataByTag("materia"),this.tapping=a.getDataByTag("tapping"),this.flow1=a.getDataByTag("flow1"),this.flow2=a.getDataByTag("flow2"),this.car=a.getDataByTag("car"),this.track=a.getDataByTag("track"),this.g3d.setEye([-108,940,1837]),this.g3d.getHighlightHelper().mode=0,this.loadData(),setInterval(function(){e.loadData()},5e3),setTimeout(function(){e.addTask(),e.startCarAnimation()},2500);var l=ht.Math.Vector3;this.g3d.handleScroll=function(t,e){t.preventDefault();var a=this,n=new l(a.getCenter()),i=new l(a.getEye()),r=i.clone().sub(n).normalize(),o=new l(a.getHitPosition(t,n.toArray(),r.toArray())),s=e<0?1.05:1/1.05;i.lerpVectors(o,i,s),n.lerpVectors(o,n,s),i.distanceTo(n)<15&&s<1||(a.setEye(i.toArray()),a.setCenter(n.toArray()))}}return t(n,[{key:"loadData",value:function(){this.getLoadMaterialData(),this.getCoalgasData(),this.getTappingData()}},{key:"getLoadMaterialData",value:function(){this.materia.a({OREBATCH:o.toFixed(80*Math.random()+20,2),MATERIALBATCHNUM:Math.floor(1e3*Math.random())+12,FOCUSGROUP:o.toFixed(80*Math.random()+20,2)})}},{key:"getCoalgasData",value:function(){this.coalgas.a({A_CO:o.toFixed(100*Math.random(),2),A_CO2:o.toFixed(100*Math.random(),2),A_N2:o.toFixed(100*Math.random(),2),A_H2:o.toFixed(100*Math.random(),2)})}},{key:"getTappingData",value:function(){this.tapping.a("speed",o.toFixed(100*Math.random()))}},{key:"addTask",value:function(){var t=this.track,e=.03,a=0,n=this.dm.toDatas(function(t){return"flowArrow"===t.getDisplayName()}),i=this.dm.toDatas(function(t){return"热风炉1"===t.getDisplayName()||"热风炉2"===t.getDisplayName()}),r=0;setInterval(function(){n.each(function(t){t.s({"top.uv.offset":[-e,0],"front.uv.offset":[-e,0]})}),t.s("shape3d.uv.offset",[0,-a]),e+=.1,a+=.03,++r%30==0&&i.each(function(t){o.setValueWithAnimation(t,"percent",Math.random())})},100)}},{key:"startCarAnimation",value:function(){var e=this,a=this.car,n=this.tapping;n.a("percent",0),a.s("3d.visible",!0),n.s("3d.visible",!0),this._carIntervalTimer&&clearInterval(this._carIntervalTimer),this._carTimer&&clearTimeout(this._carTimer);var i=1044;this._carIntervalTimer=setInterval(function(){a.setY(i),(i-=2)<=131&&(clearInterval(e._carIntervalTimer),e._carIntervalTimer=null,e._carTimer=setTimeout(function(){e._carTimer=null;var t=0;e._carIntervalTimer=setInterval(function(){t+=.003,n.a("percent",t),1<=t&&(clearInterval(e._carIntervalTimer),e._carIntervalTimer=setInterval(function(){i+=2,a.setY(i),1044<=i&&(clearInterval(e._carIntervalTimer),e._carIntervalTimer=null,n.s("3d.visible",!1),a.s("3d.visible",!1),setTimeout(function(){e.startCarAnimation()},5e3))},50))},50)},3e3))},50)}}]),n}(),r=["8_17冷却壁发生渣皮减薄","局部小气流，请关注气流变化","12_19冷却壁发生渣皮减薄","10_35冷却壁发生渣皮减薄","11_38冷却壁发生渣皮减薄","炉缸热损失正常","10_15冷却壁发生渣皮减薄","7_7冷却壁发生渣皮减薄","11_15冷却壁发生渣皮减薄","4_15冷却壁发生渣皮减薄","8_12冷却壁发生渣皮减薄","11_15局部小气流","11_15炉缸热损失正常","7_7炉缸热损失异常"];return new(function(){function a(){i(this,a);this.bgGv=new ht.graph.GraphView;var t=this.g3d=new ht.graph3d.Graph3dView,e=this.gv=new ht.graph.GraphView;this.subs=[],e.getSelectWidth=function(){return 0},e.handleScroll=function(){},e.handlePinch=function(){},e.setPannable(!1),e.setRectSelectable(!1),e.setScrollBarVisible(!1),e.setMovableFunc(function(){return!1}),t.addToDOM(),e.addToDOM(t.getView()),this.init()}return t(a,[{key:"init",value:function(){this.siteCode=o.getParam("ShebeiID"),this.loadScene(),this.loadDisplay(),this.initEvent()}},{key:"startClock",value:function(){var e=this.gv.dm();setInterval(function(){var t=new Date;o.setBindingData(e,{day:o.formatDate(t,"星期w"),date:o.formatDate(t,"YYYY-MM-DD"),time:o.formatDate(t,"hh:mm"),timemm:t.getMinutes(),timehh:t.getHours()%12})},500)}},{key:"getWarningData",value:function(){for(var t=Date.now()-36e5,e=[],a=Math.floor(10*Math.random())+5,n=0;n<a;n++)e.push({TIMESTAMP:o.formatDate(new Date(t),"YYYY-MM-DD hh:mm:ss"),WARNINGINFORMATION:r[Math.floor(Math.random()*r.length)]}),t+=Math.floor(3e5*Math.random())+2e3;this.alarmTable.a("ht.dataSource",e)}},{key:"getExponentData",value:function(){var t={AQEXPONENT:50*Math.random()+50,SXEXPONENT:50*Math.random()+50,YLEXPONENT:50*Math.random()+50,ZBEXPONENT:50*Math.random()+50};o.setBindingDataWithAnimation(this.gv.dm(),t);var e={A_ETACO:[o.toFixed(10*Math.random()+40,2),o.toFixed(10*Math.random()+40,2),o.toFixed(10*Math.random()+40,2)],fuel_ratio:[o.toFixed(100*Math.random()+500,2),o.toFixed(100*Math.random()+500,2),o.toFixed(100*Math.random()+500,2)],tfe_2:[o.toFixed(15*Math.random()+50,2),o.toFixed(15*Math.random()+50,2),o.toFixed(15*Math.random()+50,2)],utility_coefficient:[o.toFixed(Math.random()+3,2),o.toFixed(Math.random()+3,2),o.toFixed(Math.random()+3,2)]};o.setBindingData(this.gv.dm(),e)}},{key:"addSimRealTimeData",value:function(t){t.A_BV5S.push(o.toFixed(2e3*Math.random()+4e3,2)),t.A_BT5S.push(o.toFixed(200*Math.random()+1e3,2)),t.A_BVO5S.push(o.toFixed(2e3*Math.random()+1e4,2)),t.A_SLE15S.push(o.toFixed(3*Math.random(),2)),t.A_SLE25S.push(o.toFixed(3*Math.random(),2)),t.A_BP5S.push(o.toFixed(50*Math.random()+200,2)),t.A_TTOP3.push(o.toFixed(50*Math.random()+300,2))}},{key:"getRealTimeData",value:function(){var t=this.realTimeData;if(t){for(var e in t)t[e]=t[e].slice(0),t[e].shift();t.xAxisData.push(o.formatDate(new Date,"YYYY-MM-DD hh:mm:ss")),this.addSimRealTimeData(t)}else{t=this.realTimeData={xAxisData:[],A_BV5S:[],A_BT5S:[],A_BVO5S:[],A_SLE15S:[],A_SLE25S:[],A_BP5S:[],A_TTOP3:[]};for(var a=Date.now()-18e5,n=0;n<30;n++)t.xAxisData.push(o.formatDate(new Date(a),"YYYY-MM-DD hh:mm:ss")),this.addSimRealTimeData(t),a+=Math.floor(45e3*Math.random()+3e4)}this.liveChart1.a(t),this.liveChart2.a(t),this.liveChart3.a(t)}},{key:"initEvent",value:function(){var e=this.gv,t=function(t){e.getDataAt(t)&&(t.preventDefault(),t.stopPropagation())};e.getView().addEventListener("mousedown",t),e.getView().addEventListener("click",t),e.getView().addEventListener("touchstart",t)}},{key:"loadScene",value:function(){var a=this;ht.Default.xhrLoad("scenes/炼铁高炉.json",function(t){a.g3d.dm().deserialize(t),a.subs.push(new n(a));var e=a.g3d.dm().getDataByTag("box");a.g3d.setSkyBox(e)})}},{key:"loadDisplay",value:function(){var t=this;this.gv.deserialize("displays/industry/高炉厂区大屏.json",function(){t.startClock(),t.alarmTable=t.gv.dm().getDataByTag("alarmTable"),t.liveChart=t.gv.dm().getDataByTag("liveChart"),t.liveChart1=t.gv.dm().getDataByTag("liveChart1"),t.liveChart2=t.gv.dm().getDataByTag("liveChart2"),t.liveChart3=t.gv.dm().getDataByTag("liveChart3"),t.getExponentData(),t.getWarningData(),t.getRealTimeData(),setInterval(function(){t.getRealTimeData()},6e3),setInterval(function(){t.getExponentData()},864e5),setInterval(function(){t.getWarningData()},48e3),t.addDashFlowTask()})}},{key:"addDashFlowTask",value:function(){var a=this.gv.dm().getDataByTag("safePro"),t={interval:100,action:function(t){if(t===a){var e=a.a("dash.offset")||0;e-=2,a.a("dash.offset",e)}}};this.gv.dm().addScheduleTask(t)}}]),a}())});
        </script>
    </body>
</html>
